<#include "/common/_layout.html"/>
<#include "/common/_search_form.html"/>
<@layout>
<h1>列管理&nbsp;&nbsp;
<a href="${BASE_PATH!}/column/add">创建列</a>
</h1>
<@search_form actionUrl="${BASE_PATH!}/column/page" initSearch=false>
隶属项目：
<select name="project_id" id="project_id">
</select>
表：
<select name="table_id" id="table_id">
</select>
<script type="text/javascript">
	$(document).ready(function(){
		var initSel_project_id = function(callback){
			SelectTool.initSelectData({
				elId:"project_id",
				url:"${BASE_PATH!}/project/listAll",
				postData:{"project_id":$("#project_id").val()},
				valueName:"id",
				textName:"project_name",
				defaultValue:"${(project_id)!}",
				haveAll:true,
				callback:callback
			});
		}
		var initSel_table_id = function(callback){
			SelectTool.initSelectData({
				elId:"table_id",
				url:"${BASE_PATH!}/table/listByProjectId",
				postData:{"project_id":$("#project_id").val()},
				valueName:"id",
				textName:"table_name",
				defaultValue:"${(table_id)!}",
				haveAll:true,
				callback:callback
			});
		}
		$("#project_id").change(function(){
			initSel_table_id(function(){
				initSearch(1);
			});
		});
		$("#table_id").change(function(){
			initSearch(1);
		});
		initSel_project_id(function(){
			initSel_table_id(function(){
				initSearch(1);
			});
		});
	});
</script>
</@search_form>
</@layout>